<template>
  <div class="field">
    <button class="but15" :class="color" v-if="type == '15'">
      <span></span><span></span><span></span><span></span>{{ text }}
    </button>
    <button class="but12" :class="color" v-else-if="type == '12'">
      {{ text }} <svg><rect></rect></svg>
    </button>
    <div class="rgb-border-round" :class="color" v-else-if="type == '11'">
      <button>{{ text }}</button>
    </div>
    <button class="a_demo_four" :class="color" v-else-if="type == '10'">
      {{ text }}
    </button>
  </div>
</template>

<script>
export default {
  props: {
    type: String,
    color: String,
    text: String,
  },
};
</script>

<style lang="scss" scoped>
div.field {
  display: inline-block;
}
div.field button {
  position: relative;
  background-color: unset;
  color: white;
  padding: 5px 10px;
  font-size: 15px;
  border: unset;
  border-radius: unset;
  cursor: pointer;
  outline: 0;
}
div.field button:hover {
  transform: scale(1.1);
  transition: all 0.075s cubic-bezier(0, 1.8, 1, 1.8);
}

.but12 svg,
.but12 svg rect {
  position: absolute;
  top: 0;
  left: 0;
  transition: 1s;
  width: 100%;
  height: 100%;
  fill: transparent;
}
.but12 svg rect {
  stroke: #f00;
  stroke-width: 3px;
  stroke-dasharray: 100% 100%;
}
.but12:hover svg rect {
  stroke: lightseagreen;
  // stroke-dashoffset: -55;
}

.but15 {
  background-color: transparent;
  position: relative;
  overflow: hidden;
  transition: 0.5s;
}
div.field .but15 span:nth-child(1) {
  position: absolute;
  width: 100%;
  height: 2px;
  top: 0;
  left: -100%;
  animation: sp1 3s linear alternate-reverse infinite;
}

@keyframes sp1 {
  from {
    left: -100%;
  }
  to {
    left: 100%;
  }
}
div.field .but15 span:nth-child(2) {
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: 0;
  right: -100%;
  animation: sp2 3s linear alternate-reverse infinite;
}
@keyframes sp2 {
  from {
    right: -100%;
  }
  to {
    right: 100%;
  }
}
div.field .but15 span:nth-child(3) {
  position: absolute;
  height: 100%;
  width: 2px;
  top: -40px;
  left: 0;
  animation: sp3 3s linear alternate-reverse infinite;
}
@keyframes sp3 {
  from {
    top: -100%;
  }
  to {
    top: 100%;
  }
}
div.field .but15 span:nth-child(4) {
  position: absolute;
  height: 100%;
  width: 2px;
  bottom: -40px;
  right: 0;
  animation: sp4 3s linear alternate-reverse infinite;
}
@keyframes sp4 {
  from {
    bottom: -100%;
  }
  to {
    bottom: 100%;
  }
}
div.field .but15:hover {
  color: #fff !important;
  border-radius: 5px;
}

div.field .but15 {
  color: #fff;
}
div.field .but15 span:nth-child(1),
div.field .but15 span:nth-child(2),
div.field .but15 span:nth-child(3),
div.field .but15 span:nth-child(4),
div.field .but15:hover {
  background-color: #fff;
}
div.field .but15:hover {
  box-shadow: 0 0 20px #fff;
}

div.field .but15.danger {
  color: #fff;
}
div.field .but15.danger span:nth-child(1),
div.field .but15.danger span:nth-child(2),
div.field .but15.danger span:nth-child(3),
div.field .but15.danger span:nth-child(4),
div.field .but15.danger:hover {
  background-color: rgb(255, 60, 0);
}
div.field .but15.danger:hover {
  box-shadow: 0 0 20px rgb(255, 60, 0);
}

div.field .but15.primary {
  color: rgb(10, 172, 247);
}
div.field .but15.primary span:nth-child(1),
div.field .but15.primary span:nth-child(2),
div.field .but15.primary span:nth-child(3),
div.field .but15.primary span:nth-child(4),
div.field .but15.primary:hover {
  background-color: rgb(10, 172, 247);
}
div.field .but15.primary:hover {
  box-shadow: 0 0 100px 3px rgb(10, 172, 247);
}

div.field .but15.warning {
  color: rgb(37, 217, 226);
}
div.field .but15.warning span:nth-child(1),
div.field .but15.warning span:nth-child(2),
div.field .but15.warning span:nth-child(3),
div.field .but15.warning span:nth-child(4),
div.field .but15.warning:hover {
  background-color: rgb(37, 217, 226);
}
div.field .but15.warning:hover {
  box-shadow: 0 0 100px 3px rgb(37, 217, 226);
}

.rgb-border-round::before {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.rgb-border-round,
.rgb-border-round::before {
  box-sizing: border-box;
  border-radius: 3em;
}
.rgb-border-round {
  display: inline-block;
  text-align: center;
  background: linear-gradient(
    155deg,
    rgba(2, 0, 36, 1),
    rgba(255, 0, 0, 1),
    rgba(255, 171, 0, 1),
    rgba(224, 255, 0, 1),
    rgba(0, 255, 8, 1),
    rgba(0, 228, 255, 1),
    rgba(0, 5, 255, 1),
    rgba(254, 0, 231, 1),
    rgba(255, 0, 0, 1),
    rgba(255, 162, 0, 1)
  ) center / 1000% 1000%;
  animation: gradient-anim 100s linear infinite;
  position: relative;
  box-shadow: 0px 0px 20px #999;
}
.rgb-border-round::before {
  content: ' ';
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 1);
  position: absolute;
  filter: blur(2px);
}

@keyframes gradient-anim {
  0% {
    background-position: 0 0;
  }
  50% {
    background-position: 1000px 1000px;
  }
  100% {
    background-position: 0 0;
  }
}

.rgb-border-round.primary button {
  color: #08ed77;
  font-weight: bold;
}
.rgb-border-round.warning button {
  color: rgb(37, 217, 226);
  font-weight: bold;
}
.rgb-border-round.danger button {
  color: rgb(255, 255, 255);
  font-weight: bold;
}

.a_demo_four {
  background-color: #eee !important;
  color: #000 !important;
  padding: 5px 10px !important;
  background-image: linear-gradient(bottom, #eee 0%, #eee 100%) !important;
  border-radius: 5px !important;
  box-shadow: inset 0px 1px 0px #999, 0px 5px 0px 0px #999 !important;
}

.a_demo_four:hover {
  background-image: linear-gradient(bottom, #eee 0%, #eee 100%) !important;
  box-shadow: inset 0px 1px 0px #999, 0px 2px 0px 0px #999 !important;
}

.a_demo_four.primary {
  background-color: #08ed77 !important;
  color: #fff !important;
  background-image: linear-gradient(bottom, #08ed77 0%, #08ed77 100%) !important;
  box-shadow: inset 0px 1px 0px #02ae55, 0px 5px 0px 0px #02ae55 !important;
}
.a_demo_four.primary:hover {
  background-image: linear-gradient(bottom, #08ed77 0%, #08ed77 100%) !important;
  box-shadow: inset 0px 1px 0px #02ae55, 0px 2px 0px 0px #02ae55 !important;
}

.a_demo_four.warning {
  background-color: rgb(37, 217, 226) !important;
  color: #fff !important;
  background-image: linear-gradient(
    bottom,
    rgb(37, 217, 226) 0%,
    rgb(37, 217, 226) 100%
  ) !important;
  box-shadow: inset 0px 1px 0px rgb(5, 180, 220), 0px 5px 0px 0px rgb(5, 180, 220) !important;
}
.a_demo_four.warning:hover {
  background-image: linear-gradient(
    bottom,
    rgb(37, 217, 226) 0%,
    rgb(37, 217, 226) 100%
  ) !important;
  box-shadow: inset 0px 1px 0px rgb(5, 180, 220), 0px 2px 0px 0px rgb(5, 180, 220) !important;
}

.a_demo_four.danger {
  background-color: rgb(213, 207, 207) !important;
  color: #000 !important;
  background-image: linear-gradient(
    bottom,
    rgb(213, 207, 207) 0%,
    rgb(213, 207, 207) 100%
  ) !important;
  box-shadow: inset 0px 1px 0px rgb(184, 183, 183), 0px 5px 0px 0px rgb(184, 183, 183) !important;
}
.a_demo_four.danger:hover {
  background-image: linear-gradient(
    bottom,
    rgb(213, 207, 207) 0%,
    rgb(213, 207, 207) 100%
  ) !important;
  box-shadow: inset 0px 1px 0px rgb(184, 183, 183), 0px 2px 0px 0px rgb(184, 183, 183) !important;
}
</style>
